.class Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;
.super Ljava/lang/Object;
.source "AppPreferenceActivity.java"

# interfaces
.implements Landroid/preference/Preference$OnPreferenceClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/opongo/blogapp/activities/AppPreferenceActivity;->onCreate(Landroid/os/Bundle;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;


# direct methods
.method constructor <init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    .line 230
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onPreferenceClick(Landroid/preference/Preference;)Z
    .locals 13
    .parameter "preference"

    .prologue
    .line 233
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    invoke-virtual {v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 234
    .local v0, context:Landroid/content/Context;
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    const-string v11, "BlogApp"

    const/4 v12, 0x0

    invoke-virtual {v0, v11, v12}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v11

    #setter for: Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;
    invoke-static {v10, v11}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->access$7(Lcom/opongo/blogapp/activities/AppPreferenceActivity;Landroid/content/SharedPreferences;)V

    .line 236
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    #getter for: Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;
    invoke-static {v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->access$8(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)Landroid/content/SharedPreferences;

    move-result-object v10

    const-string v11, "blog_details"

    const-string v12, "Error"

    invoke-interface {v10, v11, v12}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 239
    .local v1, detailString:Ljava/lang/String;
    const-string v5, "Error"

    .line 242
    .local v5, email:Ljava/lang/String;
    :try_start_0
    new-instance v9, Lorg/json/JSONObject;

    invoke-direct {v9, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 244
    .local v9, json:Lorg/json/JSONObject;
    new-instance v6, Ljava/lang/String;

    const-string v10, "request_email"

    invoke-virtual {v9, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-direct {v6, v10}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .end local v5           #email:Ljava/lang/String;
    .local v6, email:Ljava/lang/String;
    move-object v5, v6

    .line 251
    .end local v6           #email:Ljava/lang/String;
    .end local v9           #json:Lorg/json/JSONObject;
    .restart local v5       #email:Ljava/lang/String;
    :goto_0
    new-instance v8, Landroid/content/Intent;

    const-string v10, "android.intent.action.SEND"

    invoke-direct {v8, v10}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 252
    .local v8, intent:Landroid/content/Intent;
    const-string v10, "application/octet-stream"

    invoke-virtual {v8, v10}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    .line 253
    const-string v10, "text/plain"

    invoke-virtual {v8, v10}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    .line 255
    const-string v2, "\n\n-----------------------\n"

    .line 256
    .local v2, device_info:Ljava/lang/String;
    new-instance v10, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "VERSION: "

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    sget v11, Landroid/os/Build$VERSION;->SDK_INT:I

    invoke-static {v11}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    const-string v11, "\n"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 257
    new-instance v10, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "Device: "

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    sget-object v11, Landroid/os/Build;->DEVICE:Ljava/lang/String;

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    const-string v11, "\n"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 259
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    const-string v11, "window"

    invoke-virtual {v10, v11}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Landroid/view/WindowManager;

    invoke-interface {v10}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v3

    .line 260
    .local v3, display:Landroid/view/Display;
    new-instance v10, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "Display: "

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v3}, Landroid/view/Display;->getWidth()I

    move-result v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v10

    const-string v11, "x"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v3}, Landroid/view/Display;->getHeight()I

    move-result v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v10

    const-string v11, "\n"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 262
    const-string v10, "android.intent.extra.SUBJECT"

    const-string v11, "Support"

    invoke-virtual {v8, v10, v11}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 263
    const/4 v10, 0x1

    new-array v7, v10, [Ljava/lang/String;

    .line 264
    .local v7, emails:[Ljava/lang/String;
    const/4 v10, 0x0

    aput-object v5, v7, v10

    .line 265
    const-string v10, "android.intent.extra.EMAIL"

    invoke-virtual {v8, v10, v7}, Landroid/content/Intent;->putExtra(Ljava/lang/String;[Ljava/lang/String;)Landroid/content/Intent;

    .line 266
    const-string v10, "android.intent.extra.TEXT"

    invoke-virtual {v8, v10, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 268
    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    iget-object v11, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$7;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    const v12, 0x7f070038

    invoke-virtual {v11, v12}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getString(I)Ljava/lang/String;

    move-result-object v11

    invoke-static {v8, v11}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;

    move-result-object v11

    invoke-virtual {v10, v11}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->startActivity(Landroid/content/Intent;)V

    .line 270
    const/4 v10, 0x1

    return v10

    .line 246
    .end local v2           #device_info:Ljava/lang/String;
    .end local v3           #display:Landroid/view/Display;
    .end local v7           #emails:[Ljava/lang/String;
    .end local v8           #intent:Landroid/content/Intent;
    :catch_0
    move-exception v4

    .line 248
    .local v4, e:Lorg/json/JSONException;
    invoke-virtual {v4}, Lorg/json/JSONException;->printStackTrace()V

    goto/16 :goto_0
.end method
